home *** CD-ROM | disk | FTP | other *** search
- Path: rcogate.rco.qc.ca!altitude!intermedia!1-167-700-0!trinomic.technologie
- From: Trinomic.Technologie@f700.n167.z1.fidonet.org (Trinomic Technologie)
- Date: 01 Apr 96 15:26:00
- Newsgroups: comp.lang.c
- Subject: String problem
- Message-ID: <826_9604020401@intermedia.qc.ca>
- X-FTN-To: Shon Frazier
-
-
- "Can anyone tell me why NameCheck = 0 when I run the program"
-
- Your program will give you always this result because you can't use "==" to
- compare strings:
-
- if (WhereName == "John")
- {
- NameCheck = 1;
- }
-
- You must use fonction "strcmp()" to compare 2 strings
-
- ry this:
-
- #include "string.h"
-
- if (strcmp(WhereName, "John") == 0)
- ...
-
- Stephane Mercier
-
-
-
- >> De : Trinomic.Technologie@f700.n167.z1.fidonet.org ( Fidonet: Trinomic Technologie 1:167/700 )
- Via: root@intermedia.qc.ca ( 1:242/847 )
-